package com.trade.web.action;

import com.trade.services.*;
import com.trade.data.*;
import com.trade.data.type.*;
import java.util.*;

public class WelcomeUserAction{

	ILivePriceService livePriceService;

	public void setLivePriceService(ILivePriceService livePriceService){
		this.livePriceService = livePriceService;
	}

	List<HistoricalDataVO> historicalDataList;

	private String username;

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}


	public List<HistoricalDataVO> getHistoricalDataList(){
		return this.historicalDataList;
	}

	// all struts logic here
	public String execute()throws Exception {

		List<String> tickerList = new ArrayList<String>();
		tickerList.add("NIFTY");

		HistoricalDataFilterVO historicalDataFilterVO = new HistoricalDataFilterVO();
		historicalDataFilterVO.setTickerList(tickerList);
		historicalDataFilterVO.setInterval(IntervalTimeTypes.T2_MIN_3DAY); // 120 T2_MIN
		//historicalDataFilterVO.setNoOfPeriod(3); // 3 days
		historicalDataList = livePriceService.getClosePrices(historicalDataFilterVO );

		return "SUCCESS";

	}
}